package org.bastion.test;

import java.util.ArrayList;
import java.util.List;

import org.bastion.domain.Alert;
import org.bastion.service.AlertService;

public class MessageServiceTestImpl implements AlertService {

	List<Alert> alerts = new ArrayList<Alert>();
	
	public void addAlert(Alert alert) {
		alerts.add(alert);
	}

	public List<Alert> getAlerts(boolean clearAlertsAfterwards) {
		if (clearAlertsAfterwards) {
			List<Alert> copy = new ArrayList<Alert>(alerts);
			alerts.clear();
			return copy;
		}
		return alerts;
	}

}
